81 Pro components and page blocks

Get Pro

Apple Keyboard

New

Preview

Customize

Auto
Highlight colour
Volume0.60

Installation

npx shadcn@latest add https://uibrik.com/r/apple-keyboard.json
Adds the files to components/uibrik/apple-keyboard. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/apple-keyboard.

Usage

import { AppleKeyboard } from "@/components/uibrik/apple-keyboard/apple-keyboard";​<AppleKeyboard  finish="auto"  highlight={["MetaLeft", "K"]}  highlightColor="#0a84ff"  functionRow  listen  sound  volume={0.6}  defaultCapsLock={false}  onCapsLockChange={(on) => {}}  // capsLock={false}  // onKeyDown={(key) => {}}  // onKeyUp={(key) => {}}/>

Props

AppleKeyboard
finish
Type "auto" | "silver" | "black"
"auto"
Silver with white keys, black with black keys, or follow dark mode.
highlight
Type string[]
["MetaLeft","K"]
Keys to light up, by code (KeyK), character (k, 7) or name (Return, Shift).
highlightColor
Type string
"#0a84ff"
Colour of the highlight.
functionRow
Type boolean
true
The row of esc, F1–F12 and Lock along the top.
listen
Type boolean
true
Mirror the physical keyboard: keys go down as you type.
sound
Type boolean
true
Play key sounds. The first press unlocks audio, as browsers require.
volume
Type number
0.6
Loudness of the key sounds.
capsLock / defaultCapsLock
Type boolean
— / false
Whether the Caps Lock light is on, controlled or uncontrolled.
onCapsLockChange
Type (on: boolean) => void
–
Called when Caps Lock turns on or off.
onKeyDown / onKeyUp
Type (key: { id; name }) => void
–
Called as a key goes down and comes back up. id is the KeyboardEvent.code.
className
Type string
–
Classes for the wrapper. The keyboard fills its width.