Guide
Design foundations
The defaults help Buttons, fields, cards, and menus feel like one interface. Start by choosing a size. The tables further down explain the spacing and color rules behind it.
Choose a control size
Pass a size prop to a control when the default medium size does not fit. Medium is for most forms, small fits dense toolbars, and large gives a main action more room. Not every component has all three sizes; check its API page first.
<script setup lang="ts">
import Button from './components/ui/button/Button.vue'
</script>
<template>
<Button size="sm">Compact</Button>
<Button size="md">Default</Button>
<Button size="lg">Prominent</Button>
</template>| Size | Prop | Typical height | Good for |
|---|---|---|---|
| Small | sm | 32px | Dense toolbars and tables |
| Medium | md | 40px | Most forms and actions |
| Large | lg | 48px | Prominent actions and spacious layouts |
Icon buttons keep a compact visual footprint while their whole control responds to clicks. Menu and picker options use the full row as the target. On touch-heavy screens, choose a roomier size and leave space between nearby actions.
Spacing that works together
Controls follow a 4px spacing rhythm. The values below show the default horizontal padding for common parts, so fields and actions line up when you compose them. Cards use the same scale for their inner space.
| Component | Small | Medium | Large |
|---|---|---|---|
| Input, select, or combobox | 8px | 12px | 16px |
| Button | 12px | 16px | 24px |
| Card | 16px | 24px | 32px |
Menus and lists use roomy rows, while calendars keep their grid alignment. These are starting points: your copied component source can be adjusted when your layout needs a different density.
Colors, corners, and depth
Components use semantic CSS variables, so one theme change can update every matching surface. Neutral borders stay quiet; focus, selection, validation, and status colors remain distinct in light and dark themes.
| Token | Where it appears |
|---|---|
--border | Neutral outlines and dividers |
--ring | Keyboard focus |
--radius | Corners throughout the library |
--elevation-card | Depth for contained surfaces |
--elevation-popover | Depth for floating surfaces |
/* Add after importing @getweini/vue/styles/default.css. */
:root {
--radius: 16px;
--border: oklch(0.86 0.01 260);
--elevation-popover: 0 16px 40px oklch(0 0 0 / 0.12);
}See Theming for the full palette and light and dark overrides.
Interaction and accessibility
Weini controls show when they are focused, open, selected, disabled, or invalid where those states apply. Navigation keeps the current destination visible after the pointer leaves. Keyboard users can see focus, and animations respect reduced-motion preferences.
Layout-relative spacing and corners adapt to right-to-left pages. You can set dir="rtl" on an app or section; a placement prop such as side="left" still refers to that physical edge.
When building a form, add visible labels and connect error text to its field. The Forms and accessibility guide shows the pattern in Vue.