Installation

Byte is designed to work seamlessly with Ruby on Rails and modern JavaScript tooling.

Quick Install

To install Byte in a Ruby on Rails application with Importmaps, use the following command:

bin/importmap pin @afomera/byte-ui

Version Specific Install

To install a specific version of Byte, use:

bin/importmap pin @afomera/byte-ui@x.y.z
Replace x.y.z with your desired version. View all available versions on the npm package page.

Registering Components

Option 1: Register All Components

Import and register all components at once:

import { registerByteComponents } from "@afomera/byte-ui"

registerByteComponents();

Option 2: Register Individual Components

Import and register specific components as needed:

import { 
  ByteAlert, 
  ByteButton, 
  ByteCard 
} from "@afomera/byte-ui"

customElements.define('byte-alert', ByteAlert);
customElements.define('byte-button', ByteButton);
customElements.define('byte-card', ByteCard);
Pro tip: Only import the components you need to keep your bundle size small.

Next Steps

Read the Docs

Learn how to use each component

View Examples

See components in action