{
  "id": 20600408,
  "title": "How to customize UI kits without breaking accessibility",
  "url": "https://urgent.news/2026/11/18/how-to-customize-ui-kits-without-breaking-accessibility",
  "topic": "science",
  "section": "Science",
  "published": "2026-11-18T13:30:46.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/greedy_reader/how-to-customize-ui-kits-without-breaking-accessibility-444b"
  },
  "original_language": "en",
  "account": "Customizing UI kits without compromising accessibility requires a methodical approach. Begin by working with tokens instead of individual components. This allows you to change colors, spacing, radius, and typography at the source, rather than modifying each component individually. Both the SaaS Starter Kit and AI UX Kit employ CSS custom properties along with Tailwind tokens, making this approach feasible.\n\nModify the variables instead of every component. In your CSS file, define your brand colors:\n\n```css\n:root {\n--color-primary-50: #f5f3ff;\n--color-primary-100: #e0ddff;\n--color-primary-600: #5b21ff;\n--color-secondary-100: #f4f4f5;\n--color-secondary-200: #e4e4e7;\n}\n```\n\nComponents consume these tokens, inheriting your brand while preserving spacing, hierarchy, and focus styling. When altering colors, adhere to safe practices to avoid breaking accessibility. Adjust tokens in a single location and verify contrast for pivotal pairs, such as primary-600 on white text, secondary-100 or secondary-200. Utilize tools like @axe-core/react, browser developer tools, or design software to assist, but recognize that the kits initiate from WCAG-compliant defaults.\n\nAvoid removing focus outlines; rather, style them to align with your brand. Most kits already include components that manage focus states, so your task is to adjust token values or utility classes. Import the necessary button component and apply focus-visible styles:\n\n```jsx\nimport { Button, ButtonLabel } from \"@/components/ui/primitives/button\";\n\nexport function PrimaryAction() {\nreturn (\n<Button\naction=\"primary\"\nclassName=\"focus-visible:ring-2 focus-visible:ring-primary-300 focus-visible:ring-offset-2\"\n<ButtonLabel>Saving changes</ButtonLabel>\n</Button>\n);\n}\n```\n\nFor global customization, implement it in one place. Define global styles in a CSS file:\n\n```css\n:root {\n--focus-ring-color: rgba(91, 33, 255, 0.35);\n}\n\nbutton:focus-visible,\ninput:focus-visible,\n[role=\"button\"]:focus-visible {\noutline: 2px solid var(--focus-ring-color);\noutline-offset: 2px;\n}\n```\n\nThis method preserves keyboard navigation while maintaining an on-brand appearance. Instead of copying internal component code and editing it, wrap the existing primitive component. This preserves accessibility attributes like ARIA and focus behavior:\n\n```jsx\n// app/components/BrandButton.tsx\nimport { Button, ButtonProps, ButtonLabel } from \"@/components/ui/primitives/button\";\n\ntype BrandButtonProps = ButtonProps & { icon?: React.ReactNode };\n\nexport function BrandButton({ children, icon, ...props }: BrandButtonProps) {\nreturn (\n<Button\naction=\"primary\"\nclassName=\"rounded-full px-5 py-2 text-sm shadow-sm\"\n{...props}\n>\n{icon && <span className=\"mr-2\">{icon}</span>}\n<ButtonLabel>{children}</ButtonLabel>\n</Button>\n);\n}\n```\n\nBy wrapping the primitive, you utilize its existing ARIA attributes, focus behavior, and disabled state handling while customizing its appearance. This approach effectively customizes complex components, like PromptInput from the AI UX Kit or MainSidebar from the SaaS Starter Kit, without compromising accessibility. Identify which aspects should be customizable props (labels, placeholders, icons, badges, etc.) and employ Tailwind className overrides instead of structural modifications.",
  "summary": "The problem You pull in a UI kit to move fast, then customize colors and spacing and suddenly focus states vanish, contrast fails in dark mode, and semantic buttons become plain <div> s. Start with tokens, not components The fastest way to rebrand without breaking things is to work at the token level: colors, spacing, radius, typography. Both the SaaS Starter Kit and AI UX Kit use CSS custom…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}