@frontpanel/vue
v0.6.0
Published
Vue 3 components for the Frontpanel early-2000s hardware skin: a scale-to-fit device frame, windows, chrome and gel buttons, caps, LCDs and LEDs, built on Reka UI.
Maintainers
Readme
@frontpanel/vue
Vue 3 components for the Frontpanel early-2000s hardware skin: a device frame that can scale to
fit, windows, chrome and gel buttons, molded caps, LCD lines, LEDs and a pixel icon set. Behaviour
and ARIA come from Reka UI; the look comes from
@frontpanel/css.
The UI kit behind WhatsTheNextChord.
Documentation: guides, live demos, and every component, class and token.
0.x: props may still change between minor versions. Pin the version.
Install
npm install @frontpanel/vueIt needs Vue 3.5 or later. @frontpanel/css comes with it; the components ship no CSS of their
own, so import the stylesheet once:
import '@frontpanel/css/index.css'
import '@frontpanel/css/fonts.css' // optional: the display and LCD fontsWith Tailwind 4, import @frontpanel/css/tailwind.css instead (see its README), and add an
@source line for this package. Tailwind doesn't scan node_modules, so without it the classes
the components use are never generated. Give the path from your CSS file:
@source "../node_modules/@frontpanel/vue/dist";Example
<script setup lang="ts">
import { FpButton, FpDevice, FpGelButton, FpLcd, FpLcdLine, FpLed, FpWindow } from '@frontpanel/vue'
import { ref } from 'vue'
const playing = ref(false)
</script>
<template>
<FpDevice fit="width" :width="600">
<FpWindow title="Deck">
<FpLcd>
<FpLcdLine :text="playing ? 'PLAYING' : 'STOPPED'" ghost :cells="12" redraw />
</FpLcd>
<FpLed :lit="playing" color="amber" />
<FpButton :pressed="playing" @click="playing = !playing">
Play
</FpButton>
<FpGelButton>Save</FpGelButton>
</FpWindow>
</FpDevice>
</template>Components
| Component | What it is |
| --- | --- |
| FpDevice | The device: a molded body in a liquid-chrome rim on a backdrop. fit="width" or "contain" draws it at a design width and scales it to the room it has; the default fit="none" leaves layout to your page |
| FpWindow | A matte module with a chrome title bar: title, level, closable (emits close), an actions slot, and sheet for a phone bottom sheet |
| FpButton | A brushed-chrome push button; pressed makes it a toggle |
| FpButtonGroup | Chrome buttons joined into one bezel, as a named group |
| FpMenu, FpMenuItem, FpMenuSeparator | A faceplate menu that drops from the button in its trigger slot; rows emit select, or are links with as="a" |
| FpGelButton | The glossy gel pill, for the panel's main action |
| FpCap | A molded-plastic cap in white, blue, amber, graphite or berry; pressed holds it down with a ring |
| FpLcd, FpLcdLine | LCD glass, and a line of text on it with optional unlit segments (ghost, cells) and a left-to-right redraw |
| FpLed | A green, amber or red LED; lit, and blink to confirm an action |
| FpHousing, FpWell, FpSilk, FpScrew | A dark housing for LEDs, a recessed well, a silkscreened label, a screw head |
| FpIcon | A 21-glyph 16 px pixel icon set (fpIconNames) |
Element components take Reka's as and asChild.
Accessibility
- LEDs and icons are decorative (
aria-hidden) unless you give them alabel, which makes them an image with that name. Say an LED's state in text nearby, or label it; colour alone never carries meaning. - An icon-only button needs a name. Put
aria-labelon theFpButtonand leave theFpIconinside it decorative. pressedmakes a toggle. OnFpButtonandFpCapit setsaria-pressedand holds the control down; leave it unset for an ordinary button, which then gets noaria-pressed.- A short key label can have a full spoken name. The options of
FpRadioGroupandFpCheckboxGroupare named by their printedlabel; where that is an abbreviation, add anariaLabel(STDprinted,Standard (EADGBE)spoken). - Closing an
FpWindowremoves the focused close button. Move focus back to the control that opened the window. FpSilkis a span. Render it as a heading orlabel(as="h3",as="label") where it names something.- Every control shows a focus ring, every text colour pairing passes WCAG AA in both skins, every
component is scanned with axe in both skins, and each moving part respects
prefers-reduced-motion.
Licence
MIT.
