GitHub

Brand Switcher

Dropdown for switching between brand configurations

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { BrandSwitcher } from "@corew500/ui/brand-switcher"

<BrandSwitcher>Content</BrandSwitcher>

API Reference

Props

PropTypeDefaultDescription
optionsBrandOption[][ { value: "default", label: "Default" }, { value: "kilalo", label: "Kilalo" }, ]Custom brand options (overrides defaults)
showLabelenumfalseShow brand label in trigger button
ariaLabelstringSelect brand themeAccessible label for screen readers
classNameenumCSS class applied to the element, or a function that returns a class based on the component’s state.
styleenumStyle applied to the element, or a function that returns a style object based on the component’s state.
variantenumghost
sizeenumicon
animatedenumtrueEnable hover scale and active press micro-interactions. Uses motion-safe media query to respect user preferences.
loadingenumfalseShow loading spinner and disable the button. When true, replaces iconStart with a spinner and sets aria-busy.
iconStartenumIcon to display at the start (left) of the button text. Automatically hidden when loading is true.
iconEndenumIcon to display at the end (right) of the button text. Remains visible during loading state.
fullWidthenumfalseMake the button expand to fill its container width.
glowenumfalseEnable animated gradient glow effect on hover. Adds decorative gradient lines below the button.
focusableWhenDisabledenumfalseWhether the button should be focusable when disabled.
nativeButtonenumtrueWhether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (e.g. `<div>`).
renderenumAllows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

Accessibility

Keyboard Navigation

  • Keyboard navigable via standard dropdown menu patterns

Screen Readers

  • - Button has aria-label for screen reader announcement

Additional

  • Current selection indicated with checkmark icon

Localization

Translatable Content

  • - Labels can be customized via the options prop for i18n
  • ariaLabel prop should be localized

Related

Related Components