ComponentsFoundations
Slot
Slot merges its props and classes into its only child — the engine of asChild — and VisuallyHidden names things for screen readers only.
- Domain
- Foundations
- Support level
- Size
- 0.2 kB gzip, budget 2.0 kB
- Who uses it
- No live product imports it yet Counted in the dated inventory of 2026-11-23.
import { Slot, VisuallyHidden } from "@krizaka/ui/slot";Web only — React, from @krizaka/ui/slot. Stable: its API only changes in a major version.
- Mobile · n/a. asChild merges props into a DOM child; React Native composes with Pressable instead.
Why it is here. The `asChild` mechanism: every primitive that renders your own link or element is built on it.
When to use
- To give your own component an
asChildprop. VisuallyHiddenfor words that only assistive technology needs: an icon button's name, a table caption.
When not to use
- To style a link like a button:
asChildon the button does it.Use instead: Button - To hide something from everyone: use
hidden.
Installation
Install
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Import
import { Slot, VisuallyHidden } from "@krizaka/ui/slot";Examples
Slot
The link is rendered, styled by the Slot.
VisuallyHidden
An icon button named for screen readers.
Props
This module has no component props: see the import and the preview above.
Accessibility
VisuallyHiddenis read by screen readers and not shown.Slotkeeps the child's element: a link stays a link, with its role and keyboard.
Best practices
Slottakes exactly one child element.- Prefer a visible label to
VisuallyHiddenwhen there is room for one.
Related components
Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub