Skip to content

Latest commit

 

History

History

accessible-icon

Folders and files

README.md

@fictjs/accessible-icon

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.

Installation

pnpm add @fictjs/accessible-icon fict

Usage

/** @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>
  )
}

Anatomy

  • AccessibleIcon.Root (Root) — label (required). Renders the child icon with aria-hidden and appends a @fictjs/visually-hidden label for screen readers.

Exports

  • Components: AccessibleIcon (Root).
  • Types: AccessibleIconProps.

Documentation

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.

License

MIT © Fict contributors.