7.4 KiB
Blueprint Components
Blueprint provides a rich set of components for building modern web interfaces. Each component is designed to be responsive, accessible, and consistent with the dark theme.
Layout Components
Section
Container for page sections:
section(wide, centered) {
// Content
}
Properties:
wide
: Full width with max-width constraint (1200px)centered
: Center content horizontally and verticallyalternate
: Alternate background colorpadding
: Custom padding in pixelsmargin
: Custom margin in pixels
Grid
Responsive grid layout:
grid(columns:3) {
// Grid items
}
Properties:
columns
: Number of columns (default: auto-fit)responsive
: Enable responsive behaviorgap
: Custom gap size between itemswidth
: Custom width in percentage
Horizontal
Horizontal flex container:
horizontal(centered, spaced) {
// Horizontal items
}
Properties:
centered
: Center items verticallyspaced
: Space between itemsgap
: Custom gap sizewidth
: Custom width in percentageresponsive
: Wrap items on small screens
Vertical
Vertical flex container:
vertical(centered) {
// Vertical items
}
Properties:
centered
: Center items horizontallyspaced
: Space between itemsgap
: Custom gap sizewidth
: Custom width in percentage
Typography
Title
Page or section titles:
title(huge) { "Main Title" }
title(large) { "Section Title" }
Properties:
huge
: Very large size (4rem)large
: Large size (2rem)bold
: Bold weightcentered
: Center aligncolor
: Custom text color
Text
Regular text content:
text(large) { "Large text" }
text(subtle) { "Subtle text" }
Properties:
large
: Larger sizesmall
: Smaller size (0.875rem)subtle
: Muted colorbold
: Bold weightcolor
: Custom text color
Navigation
Navbar
Fixed navigation bar:
navbar {
horizontal {
text(bold) { "Brand" }
links {
link(href:home) { "Home" }
link(href:about) { "About" }
}
}
}
Properties:
sticky
: Fixed to toptransparent
: Transparent backgroundbackgroundColor
: Custom background color
Links
Navigation link group:
links {
link(href:page1) { "Link 1" }
link(href:page2) { "Link 2" }
}
Properties:
spaced
: Add spacing between linksvertical
: Vertical orientationgap
: Custom gap size
Link
Individual link:
link(href:page, text:"Click here") { }
link(href:https://example.com) { "External Link" }
Properties:
href
: Target URL or pagetext
: Link text (optional)external
: Open in new tab (automatic for http/https URLs)color
: Custom text color
Interactive Components
Button
Various button styles:
button { "Primary" }
button-secondary { "Secondary" }
button-light { "Light" }
button-compact { "Compact" }
Properties:
disabled
: Disabled statewidth
: Custom width in percentagebackgroundColor
: Custom background colorcolor
: Custom text color
Card
Content container with hover effect:
card {
title { "Card Title" }
text { "Card content" }
button { "Action" }
}
Properties:
raised
: Add shadow and hover effectwidth
: Custom width in percentagepadding
: Custom padding in pixelsbackgroundColor
: Custom background color
Badge
Status indicators:
badge { "New" }
badge(color:blue) { "Status" }
Properties:
color
: Custom badge colorbackgroundColor
: Custom background colorwidth
: Custom width in percentage
Alert
Notification messages:
alert(type:info) { "Information message" }
Properties:
type
: info, success, warning, errorbackgroundColor
: Custom background colorcolor
: Custom text colorwidth
: Custom width in percentage
Tooltip
Hover tooltips:
tooltip(text:"More info") {
text { "Hover me" }
}
Properties:
text
: Tooltip textposition
: top, right, bottom, leftbackgroundColor
: Custom background colorcolor
: Custom text color
Form Elements
Input
Text input field:
input(placeholder:"Type here") { }
Properties:
placeholder
: Placeholder texttype
: Input type (text, email, password, etc.)required
: Required fielddisabled
: Disabled statewidth
: Custom width in percentage
Textarea
Multi-line text input:
textarea(placeholder:"Enter message") { }
Properties:
placeholder
: Placeholder textrows
: Number of visible rowsrequired
: Required fieldwidth
: Custom width in percentage
Select
Dropdown selection:
select {
option { "Option 1" }
option { "Option 2" }
}
Properties:
placeholder
: Placeholder textrequired
: Required fielddisabled
: Disabled statewidth
: Custom width in percentage
Checkbox
Checkbox input:
horizontal {
checkbox { }
text { "Accept terms" }
}
Properties:
checked
: Default checked staterequired
: Required fielddisabled
: Disabled statewidth
: Custom width in percentage
Radio
Radio button input:
vertical {
horizontal {
radio(name:"choice") { }
text { "Option 1" }
}
horizontal {
radio(name:"choice") { }
text { "Option 2" }
}
}
Properties:
name
: Group namechecked
: Default checked statedisabled
: Disabled statewidth
: Custom width in percentage
Switch
Toggle switch:
horizontal {
switch { }
text { "Enable feature" }
}
Properties:
checked
: Default checked statedisabled
: Disabled statewidth
: Custom width in percentage
Container Components
List
Ordered or unordered lists:
list {
text { "Item 1" }
text { "Item 2" }
}
Properties:
ordered
: Use ordered listbullet
: Show bulletsspaced
: Add spacingwidth
: Custom width in percentage
Table
Data tables:
table {
row {
cell { "Header 1" }
cell { "Header 2" }
}
row {
cell { "Data 1" }
cell { "Data 2" }
}
}
Properties:
striped
: Alternate row colorsbordered
: Add borderscompact
: Reduced paddingwidth
: Custom width in percentage
Progress
Progress indicators:
progress(value:75, max:100) { }
Properties:
value
: Current valuemax
: Maximum valueindeterminate
: Loading statewidth
: Custom width in percentage
Slider
Range input:
slider(min:0, max:100, value:50) { }
Properties:
min
: Minimum valuemax
: Maximum valuestep
: Step incrementdisabled
: Disabled statewidth
: Custom width in percentage
Media
Images and videos with responsive behavior:
media(src:/path/to/image.jpg) { "Image description" }
media(src:https://example.com/video.mp4, type:video) { "Video description" }
Properties:
src
: URL or path to the media file (required)type
: Media type (img
orvideo
, defaults toimg
)width
: Custom width in percentageheight
: Custom height in percentagepadding
: Custom padding in pixelsmargin
: Custom margin in pixels
The media component automatically:
- Scales images/videos responsively (max-width: 100%)
- Maintains aspect ratio (height: auto)
- Adds rounded corners
- Includes a subtle hover effect
- Uses the content as alt text for images
- Adds video controls when type is video