Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kwangure/strawberry

🍓 A set of Svelte components
https://github.com/kwangure/strawberry

svelte svelte-component svelte-components sveltejs

Last synced: 24 days ago
JSON representation

🍓 A set of Svelte components

Awesome Lists containing this project

README

        

# Strawberry

Svelte utils and components.

## Installation

```bash
npm i @kwangure/strawberry

```

## General usage

### Button

```html

import '@kwangure/strawberry/css/button.css';

let count = 0;

count++}>
Increment Counter: {count}

```

### Code

```html

import { javascript } from '@kwangure/strawberry/code';

const code = 'const five = 5;\nconst thirty = five * 6';


{#each javascript(code) as { segment, color }}
{segment}
{/each}

```

### Dialog

```html

import { Dialog } from '@kwangure/strawberry/default/dialog';

/** @type {false | 'modal' | 'non-modal'} */
let open;

Nice to meet you
open = false}>👋 Bye!

open = 'modal'}>Show
open = 'non-modal'}>Show modal

```

### Dropdown

```html

import { Dropdown, Popup } from '@kwangure/strawberry/default/dropdown';


Click for dropdown


Purple

Penguin

Has

Landed

```

### Element

```html

import { Element } from '@kwangure/strawberry/default/element';

const element = {
type: 'p',
props: {
style: 'font-style: italic; color: red;',
},
children: ['I am a dynamically generated red <p/> tag element.'],
};

```

### Inputs

```html

import { Container } from '@kwangure/strawberry/default/input/container';


This is the input label


Pick a pizza toping.


Pineapple
Pepperoni
Peppers

```

### Switch

```html

import { Switch } from '$lib/default/switch';

let checked = true;

{checked ? '': 'un'}checked

```

## License

[Apache 2.0](./LICENSE) © Kafungo Wangure