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

https://github.com/markusand/bocins

Collection of reusable UI components for Vue 3
https://github.com/markusand/bocins

components ui vue3

Last synced: 4 months ago
JSON representation

Collection of reusable UI components for Vue 3

Awesome Lists containing this project

README

          

# Bocins

Collection of reusable UI components for Vue 3 that can be used standalone or combined together to create flexible and customized interfaces. The term **bocins** is derived from catalan and means *small bits or pieces of something*.

Explore all components in [Storybook](https://bocins.netlify.app).

![bocins](https://github.com/markusand/vue-ui-components/assets/12972543/762e3261-34bf-470b-8420-0c56f6333d37)

[![NPM](https://img.shields.io/npm/v/bocins)](https://npmjs.org/package/bocins)
[![NPM](https://img.shields.io/bundlephobia/minzip/bocins)](https://npmjs.org/package/bocins)
[![NPM](https://img.shields.io/npm/l/bocins)](https://npmjs.org/package/bocins)
[![Netlify Status](https://api.netlify.com/api/v1/badges/57ca7f9d-4047-4f47-b37c-53102f268e60/deploy-status)](https://app.netlify.com/sites/bocins/deploys)

## Get started

Install the library

```bash
npm i bocins
```

Default icons are copied from `/node_modules/bocins/dist/icons` to `/public/icons/`. Replace them to use your own icons. Existing icons won't be replaced.

Import styles in your app entry point file or in your styles entry point

```ts
// main.ts
import 'bocins/dist/style.css';

// main.scss
@import 'bocins/dist/style.css';
```

You can customize the theme using CSS variables and extending some base styles

```css
:root {
font-size: 16px;
font-family: system-ui, Arial, sans-serif;

color-scheme: light dark;

--color-bg: light-dark(#f8f8f8, #333);
--color-text: light-dark(#333, #efefec);
--color-error: #d33;
--color-accent: #39f;
--btn-color: var(--color-accent);
}

body {
background-color: var(--color-bg);
color: var(--color-text);
}

.btn[alert] { --color: var(--color-error); }

.switch {
--color-on: lightgreen;
--color-off: var(--color-error);
}
```

## Usage

Import and use components directly in your vue files

```html




{{ user.name }}

import { ref } from 'vue';
import { Selector, Avatar } from 'bocins';
import store, { type User } from './store';

const user = ref<User>();

.avatar { --size: 1.5rem; }

```