Advanced
Optional
React components
sashimi UI is built around plain HTML by design.
However, if you are using React, you can take advantage of dedicated components to make the most of it.
sashimi UI React components add useful behaviors to standard HTML elements.
They always render a single HTML element.
Usage
Just import components from sashimi-ui/react or sashimi-ui/react/sui-prefixed.
For example, <Dialog/> adds declarative visibility, anchored positioning, and click-away handling while rendering only a single native <dialog/> element.
import { Dialog } from "sashimi-ui/react";
// Or when you need `.sui-` prefixed class names
// import { Dialog } from "sashimi-ui/react/sui-prefixed";
// inside your component
<button ref={buttonRef} className="button" type="button" onClick={() => setOpen(true)}>
Menu
</button>
<Dialog mode="popover" open={open} anchor={buttonRef.current} onClickAway={() => { setOpen(false); }}>
<ul style={{ listStyle: "none", padding: 0 }}>
{/* Menu items */}
</ul>
</Dialog>
Requirements
React components require React and React DOM 19:
react >=19.0.0 <20.0.0
react-dom >=19.0.0 <20.0.0
These dependencies are optional when using only the CSS.
Available components
| Component | Renders | Provides |
|---|---|---|
<Dialog/> | dialog | Declarative visibility, anchored positioning, and click-away handling |
<Input/> | input | Fieldset-aware styling |
<Textarea/> | textarea | Fieldset-aware styling |
<Select/> | select | Fieldset-aware styling |
<Checkbox/> | input | Fieldset-aware styling |
<Switch/> | input | Fieldset-aware styling |
<Radio/> | input | Fieldset-aware styling |
<CardOption/> | label | Fieldset-aware styling |
<FileInput/> | input | Fieldset-aware styling and drag-over feedback |
<Label/> | label | Fieldset-aware styling |
<Legend/> | legend | Fieldset-aware styling |
<HelperText/> | p | Fieldset-aware styling |
<Fieldset/> | fieldset | Propagates error status to its children |