CSS Components Available in slyds
Navigate with arrow keys. Press N for speaker notes.
This presentation demonstrates all the CSS components available in slyds out of the box. Each slide showcases a different component with real usage examples.
Inline code uses monospace styling with a dark background.
func Build(root string) (*Result, error) {
html, err := resolveIncludes(root, "index.html")
if err != nil {
return nil, fmt.Errorf("include resolution: %w", err)
}
inlined, warnings := InlineAssets(html, root)
return &Result{HTML: inlined, Warnings: warnings}, nil
}
$ slyds init "My Talk" --theme dark -n 6
Created "my-talk" with 6 slides (theme: dark).
$ slyds build my-talk
Built dist/index.html (42 KB, 6 slides)
Code blocks use the theme's monospace font and dark background. The dark theme styles them with a GitHub-dark inspired color scheme. Both inline code and pre/code blocks are styled automatically.
Use the .highlight class for callout boxes:
rgba(0, 212, 255, 0.1) background and a cyan left border — keeping the box visible without overwhelming the content.
<div class="highlight"> — paragraphs, lists, even code blocks work inside callouts.
The highlight class provides a versatile callout component. Each theme styles it differently — the default theme uses a gradient background, while the dark theme uses a semi-transparent cyan tint. The left border provides visual anchoring.
The .stats-grid and .stat-box classes create metric displays:
repeat(auto-fit, minmax(250px, 1fr)).
The stats grid is perfect for dashboards, KPI slides, or any time you need to show numbers at a glance. The stat-number class gets the theme's accent color (cyan in dark theme), and the grid is responsive by default.
<div class="highlight">
<strong>Tip:</strong>
Use callouts for
key information.
</div>
Write plain HTML — no custom syntax or preprocessors needed.
The theme CSS handles all the visual styling automatically.
The two-column layout uses flexbox with a subtle left-column border separator. Perfect for before/after comparisons, source vs. rendered views, or any side-by-side content. The col-left class gets a right border for visual separation.
The .tier-table class styles tables with themed headers and alternating rows:
| Component | CSS Class | Use Case |
|---|---|---|
| Callout Box | .highlight |
Tips, warnings, key takeaways |
| Stats Grid | .stats-grid |
KPIs, metrics, numbers at a glance |
| Data Table | .tier-table |
Comparisons, feature matrices |
| Phase Box | .phase-box |
Timelines, project phases, steps |
| Two Column | .layout-two-column |
Side-by-side comparisons |
The tier-table class provides a clean, themed table with colored header row and alternating row backgrounds. The dark theme uses a subtle hover effect on rows. Tables collapse borders and use consistent padding.
The .phase-box class is ideal for timelines and step-by-step content:
Run slyds init to create a presentation skeleton with your chosen theme. Each slide gets its own HTML file in the slides/ directory.
Edit each slide as plain HTML. Use the CSS components shown in this deck — callouts, stats, tables, code blocks. Run slyds serve to preview live.
Run slyds build to produce a single self-contained HTML file. Host it anywhere — GitHub Pages, S3, or just email the file.
Phase boxes provide a structured way to show sequential steps, project phases, or timelines. Each box has a colored left border and subtle background. The h3 inside uses the theme's accent color. Stack them vertically for a natural timeline flow.
Every component in this deck is available in all slyds themes.
Slides are just HTML — add your own CSS classes too.
All these components work across every slyds theme. The theme CSS adapts colors and typography, but the component structure stays the same. And since slides are plain HTML, you can always add custom CSS for project-specific components.
The floater slot supports pinned overlays that stay fixed within the slide. Use it for footers, watermarks, logos, or any persistent element.
| Pattern | Position | Use case |
|---|---|---|
| Footer | Bottom, full width | Confidentiality notices, copyright |
| Watermark | Center, rotated | Draft stamps, status labels |
| Badge | Top-right corner | Logos, slide tags, status indicators |
All three are position: absolute within the slide via .slide-floater. Populate with slyds query:
slyds query 9 '[data-slot="floater"]' --set '<span style="...">Content</span>'
This slide demonstrates three floating overlay patterns. The floater slot uses position:absolute within the slide. Multiple floaters can coexist — the footer, watermark, and badge are all visible simultaneously. The floater slot in the layout template is the primary one addressed by data-slot="floater"; additional floaters use the .slide-floater class directly.