@tinypop/react
v0.1.8
Published
Tinypop React components — themeable via CSS variables (@tinypop/tokens)
Maintainers
Readme
@tinypop/react
React components for the Tinypop design system. Styled with CSS variables from @tinypop/tokens (light/dark and custom themes).
Installation (npm)
Install the React components, tokens, and the icons peer dependency:
npm install @tinypop/react @tinypop/tokens @tabler/icons-react- @tinypop/tokens — Required. Components use its CSS variables for colors, radii, and shadows. Import it once in your app.
- @tabler/icons-react — Peer dependency. Used for built-in icon support (e.g. Button
loadingspinner). If you already use Tabler Icons, you can skip installing it again.
Setup
Install tokens in your React app (see above).
Import the tokens once (e.g. in
main.tsx,index.tsx, or your root CSS):import '@tinypop/tokens';Or in your root CSS:
@import '@tinypop/tokens';Import the component styles (if your build doesn’t bundle them automatically):
import '@tinypop/react/style.css';Set the theme on a root element (e.g.
<html data-theme="light">ordata-theme="dark").
Usage
import { Button } from '@tinypop/react';
import '@tinypop/tokens';
import '@tinypop/react/style.css';
function App() {
return (
<>
<Button color="primary" variant="filled">Save</Button>
<Button color="secondary" variant="outlined">Cancel</Button>
<Button variant="ghost" disabled>Disabled</Button>
</>
);
}Button props
variant:'filled'|'outlined'|'ghost'(default:'filled')size:'xs'|'sm'|'md'|'lg'|'xl'(default:'md')color:'primary'|'secondary'|'accent'|'success'|'warning'|'error'|'info'|'neutral'|'surface'|'muted'(default:'primary')children: label or contentloading: whentrue, shows a spinner (TablerIconLoader2) and disables the buttonstartIcon: optional icon component from@tabler/icons-react(e.g.IconHeart); Button renders it before the label with size andcurrentColormatching the button variant/size; hidden whenloadingendIcon: same asstartIcon, rendered after the label- All standard HTML button attributes are supported (
disabled,onClick, etc.).
Custom theming
Override --tinypop-* CSS variables in your app to customize colors and spacing. See @tinypop/tokens for the list of variables.
