npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brokalia/ui

v2.0.7

Published

Librería de componentes UI reutilizables

Readme

@brokalia/ui

Librería de componentes UI reutilizables

  • Versión actual: 2.0.5
  • Vue requerido: ^3.5.0

Instalación

npm install @brokalia/ui

Uso Rápido

Opción 1: Plugin Global (todos los componentes)

Registra todos los componentes automáticamente de forma global.

// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import Ui from '@brokalia/ui'
import '@brokalia/ui/styles'

const app = createApp(App)
app.use(Ui)
app.mount('#app')
<!-- Usar cualquier componente sin import -->
<template>
  <ui-button @click="handleClick">Haz clic</ui-button>
  <ui-input v-model:value="name" />
</template>

Opción 2: Imports Granulares

Importa solo los componentes que necesites.

import { createApp } from 'vue'
import { UiButton, UiInput } from '@brokalia/ui'
import '@brokalia/ui/button/styles'
import '@brokalia/ui/input/styles'

const app = createApp(App)
app.component('UiButton', UiButton)
app.component('UiInput', UiInput)

app.mount('#app')
<!-- O importálos directamente en el SFC -->
<template>
  <ui-button @click="handleClick">Haz clic</ui-button>
  <ui-input v-model:value="name" />
</template>

<script setup>
import { UiButton, UiInput } from '@brokalia/ui'
</script>

Sistema de Estilos

Bundle Completo de Estilos

Todos los estilos de componentes en una entrada.

@use '@brokalia/ui/styles'

Tambien puedes configurarlo antes de cargar el bundle completo:

@use '@brokalia/ui/styles' with (
  $tablet: 820px,
  $radius: 8px,
  $button-radius: 999px
)

Por Componente

Importa primero los estilos base y luego los específicos:

@use '@brokalia/ui/styles/base'
@use '@brokalia/ui/button/styles'
@use '@brokalia/ui/input/styles'

Si quieres personalizar variables !default y reutilizar mixins globales, usa styles/base como entrypoint Sass:

@use '@brokalia/ui/styles/base' as * with (
  $tablet: 820px,
  $radius: 8px,
  $primary: #0b57d0
);

.layout {
  @include tablet {
    padding: 2rem;
  }
}

Cada componente con variables propias tambien puede configurarse desde su subpath publico:

@use '@brokalia/ui/button/styles' with (
  $button-radius: 999px,
  $button-font-size-m: 1rem
);

Sistema de Estilos Personalizado

Variables SCSS

La libreria expone variables Sass con !default para configuracion en tiempo de compilacion y CSS custom properties para tematizacion en runtime.

Ejemplo con UiButton:

:root {
  --ui-button-primary-background: #0045b7;
  --ui-button-primary-color: white;
  --ui-button-primary-border: 1px solid #0045b7;
}

.theme-dark {
  --ui-button-primary-background: #1a5cff;
}

Breakpoints

// Media breakpoints (en src/shared/constants/Media.ts)
Mobile: 300px
MobileL: 480px
Tablet: 768px
Desktop: 1024px
DesktopL: 1200px
DesktopXl: 1400px

Espacio de Nombres CSS

Todos los componentes usan el prefijo ui- y la convención BEM:

.ui-button              // Block
.ui-button__icon        // Element
.ui-button--primary     // Modifier
.is-active             // State

Directivas

v-click-outside

Detecta clicks fuera de un elemento. Útil para cerrar menús o modales.

<template>
  <div v-click-outside="handleClickOutside">
    <ui-menu :visible="menuVisible">
      <!-- contenido del menú -->
    </ui-menu>
  </div>
</template>

<script setup>
const menuVisible = ref(true)
const handleClickOutside = () => {
  menuVisible.value = false
}
</script>