Accessible icon primitive for Fict, modeled after @radix-ui/react-accessible-icon. Makes a decorative icon accessible by adding a visually hidden label and hiding the icon from assistive technology.
Part of ui-primitives, a port of Radix Primitives to Fict.
pnpm add @fictjs/accessible-icon fict/** @jsxImportSource fict */
import * as AccessibleIcon from '@fictjs/accessible-icon'
export function Example() {
return (
<button>
<AccessibleIcon.Root label="Close">
<svg viewBox="0 0 15 15" aria-hidden />
</AccessibleIcon.Root>
</button>
)
}AccessibleIcon.Root(Root) —label(required). Renders the child icon witharia-hiddenand appends a@fictjs/visually-hiddenlabel for screen readers.
- Components:
AccessibleIcon(Root). - Types:
AccessibleIconProps.
The API mirrors Radix, so the upstream Radix Accessible Icon docs apply. See the ui-primitives overview and the architecture guide for the Fict-specific reactivity model.
MIT © Fict contributors.