There are following components included:
Button
- single buttonName | Type | Default | Description |
---|---|---|---|
clear | boolean | undefined | Makes button in clear style (without fill color). Overwrites |
clearIos | boolean | false | Makes button in clear style (without fill color) in iOS theme |
clearMaterial | boolean | false | Makes button in clear style (without fill color) in Material theme |
colors | object | Object with Tailwind CSS colors classes | |
colors.activeBgIos | string | 'active:bg-primary' | |
colors.activeBgMaterial | string | '' | |
colors.disabledBg | string | 'bg-black bg-opacity-10 dark:bg-white dark:bg-opacity-10' | |
colors.disabledBorder | string | 'border-black border-opacity-10 dark:border-white dark:border-opacity-10' | |
colors.disabledText | string | 'text-black text-opacity-30 dark:text-white dark:text-opacity-30' | |
colors.fillActiveBgIos | string | 'active:bg-ios-primary-shade' | |
colors.fillActiveBgMaterial | string | '' | |
colors.fillBgIos | string | 'bg-primary' | |
colors.fillBgMaterial | string | 'bg-md-light-primary dark:bg-md-dark-primary' | |
colors.fillTextIos | string | 'text-white' | |
colors.fillTextMaterial | string | 'text-md-light-on-primary dark:text-md-dark-on-primary' | |
colors.fillTouchRipple | string | 'touch-ripple-white dark:touch-ripple-primary' | |
colors.outlineBorderIos | string | 'border-primary' | |
colors.outlineBorderMaterial | string | 'border-md-light-outline dark:border-md-dark-outline' | |
colors.textIos | string | 'text-primary' | |
colors.textMaterial | string | 'text-md-light-primary dark:text-md-dark-primary' | |
colors.tonalBgIos | string | 'bg-primary' | |
colors.tonalBgMaterial | string | 'bg-md-light-secondary-container dark:bg-md-dark-secondary-container' | |
colors.tonalTextIos | string | 'text-primary' | |
colors.tonalTextMaterial | string | 'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container' | |
colors.touchRipple | string | 'touch-ripple-primary' | |
component | string | 'button' | Component's HTML Element |
disabled | boolean | false | Makes button disabled |
href | string | Link's | |
inline | boolean | false | Makes button inline (e.g. |
large | boolean | undefined | Makes button large. Overwrites |
largeIos | boolean | false | Makes button large in iOS theme |
largeMaterial | boolean | false | Makes button large in Material theme |
outline | boolean | undefined | Makes button outline. Overwrites |
outlineIos | boolean | false | Makes button outline in iOS theme |
outlineMaterial | boolean | false | Makes button outline in Material theme |
raised | boolean | undefined | Makes button raised (with shadow). Overwrites |
raisedIos | boolean | false | Makes button raised (with shadow) in iOS theme |
raisedMaterial | boolean | false | Makes button raised (with shadow) in Material theme |
rounded | boolean | undefined | Makes button rounded. Overwrites |
roundedIos | boolean | false | Makes button rounded in iOS theme |
roundedMaterial | boolean | false | Makes button rounded in Material theme |
segmented | boolean | false | Renders segmented button, same as |
segmentedActive | boolean | false | Renders segmented active button, same as |
segmentedStrong | boolean | false | Renders segmented strong button, same as |
small | boolean | undefined | Makes button small. Overwrites |
smallIos | boolean | false | Makes button small in iOS theme |
smallMaterial | boolean | false | Makes button small in Material theme |
tonal | boolean | undefined | Makes button in tonal style (with semitransparent fill color). Overwrites |
tonalIos | boolean | false | Makes button in tonal style (with semitransparent fill color) in iOS theme |
tonalMaterial | boolean | false | Makes button in tonal style (with semitransparent fill color) in Material theme |
touchRipple | boolean | true | Enables touch ripple effect in Material theme |
onClick | function(e) |
|
<script>import {Page,Navbar,NavbarBackLink,Button,Block,BlockTitle,} from 'konsta/svelte';</script><Page><Navbar title="Buttons" /><BlockTitle>Default Buttons</BlockTitle><Block strong outlineIos class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><Button>Button</Button><Button class="k-color-brand-red">Button</Button><Button>Button</Button></div><div class="grid grid-cols-3 gap-x-4"><Button outline>Outline</Button><Button class="k-color-brand-red" outline>Outline</Button><Button outline>Outline</Button></div><div class="grid grid-cols-3 gap-x-4"><Button clear>Clear</Button><Button class="k-color-brand-red" clear>Clear</Button><Button clear>Clear</Button></div><div class="grid grid-cols-3 gap-x-4"><Button tonal>Tonal</Button><Button class="k-color-brand-red" tonal>Tonal</Button><Button tonal>Tonal</Button></div></Block><BlockTitle>Rounded Buttons</BlockTitle><Block strong outlineIos class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><Button rounded>Button</Button><Button rounded class="k-color-brand-green">Button</Button><Button rounded>Button</Button></div><div class="grid grid-cols-3 gap-x-4"><Button rounded outline>Outline</Button><Button rounded outline class="k-color-brand-green">Outline</Button><Button rounded outline>Outline</Button></div><div class="grid grid-cols-3 gap-x-4"><Button rounded clear>Clear</Button><Button rounded clear class="k-color-brand-green">Clear</Button><Button rounded clear>Clear</Button></div></Block><BlockTitle>Large Buttons</BlockTitle><Block strong outlineIos class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><Button large>Button</Button><Button large class="k-color-brand-yellow">Button</Button><Button large rounded>Button</Button></div><div class="grid grid-cols-3 gap-x-4"><Button large outline>Outline</Button><Button large outline class="k-color-brand-yellow">Outline</Button><Button large rounded outline>Outline</Button></div><div class="grid grid-cols-3 gap-x-4"><Button large clear>Clear</Button><Button large clear class="k-color-brand-yellow">Clear</Button><Button large rounded clear>Clear</Button></div></Block><BlockTitle>Small Buttons</BlockTitle><Block strong outlineIos class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><Button small>Button</Button><Button small>Button</Button><Button small rounded>Button</Button></div><div class="grid grid-cols-3 gap-x-4"><Button small outline>Outline</Button><Button small outline>Outline</Button><Button small rounded outline>Outline</Button></div><div class="grid grid-cols-3 gap-x-4"><Button small clear>Clear</Button><Button small clear>Clear</Button><Button small rounded clear>Clear</Button></div></Block><BlockTitle>Raised Buttons</BlockTitle><Block strong outlineIos class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><Button raised>Button</Button><Button raised>Button</Button><Button raised rounded>Button</Button></div><div class="grid grid-cols-3 gap-x-4"><Button raised outline>Outline</Button><Button raised outline>Outline</Button><Button raised rounded outline>Outline</Button></div><div class="grid grid-cols-3 gap-x-4"><Button raised clear>Clear</Button><Button raised clear>Clear</Button><Button raised rounded clear>Clear</Button></div></Block><BlockTitle>Disabled Buttons</BlockTitle><Block strong outlineIos class="space-y-2"><div class="grid grid-cols-3 gap-x-4"><Button disabled>Button</Button><Button disabled outline>Outline</Button><Button disabled clear>Clear</Button></div></Block></Page>