sheet
look
A sheet over a screen.
Drawn
Pick what runs on each push.
The sample
fn holders() -> Vec<Block> {
let screen = Screen::new().id("today").title("Today").blocks(vec![
text("today-hint", "3 builds ran, 1 needs you."),
marked("today-deploy", "Deploy", "waiting on review", "", Tone::Needs),
]);
let sheet = Sheet::new(
"Add a check",
vec![
text("add-note", "Pick what runs on each push."),
b!(Chips(
Chips::new("runs", vec![chip("lint"), chip("test"), chip("bench")])
.id("add-runs")
.multi(true)
.selected(vec!["lint".to_string(), "test".to_string()])
)),
button("add-check", "add", ButtonStyle::Primary),
],
)
.id("add");
let card = Card::new()
.id("ship-notes")
.kind(CardKind::Ask)
.title("Ship the 0.4 notes?")
.subtitle("asked 12 minutes ago · release")
.badge(Label {
text: "needs you".into(),
tone: Some(Tone::Needs),
})
.buttons(vec![
button("ship", "ship", ButtonStyle::Primary),
button("hold", "hold", ButtonStyle::Plain),
button("discard", "discard", ButtonStyle::Destructive),
]);
vec![
b!(Screen(screen)),
section(
"due",
"Due soon · 2",
vec![
b!(Row(row("due-cert", "Renew the cert", "expires Friday", "3d"))),
b!(Row(row("due-keys", "Rotate keys", "monthly", "5d"))),
],
),
b!(Sheet(sheet)),
b!(Card(card)),
]
}{
"blocks": [
{
"blocks": [
{
"id": "add-note",
"markdown": "Pick what runs on each push.",
"type": "text"
},
{
"fallback": {
"title": "runs"
},
"id": "add-runs",
"multi": true,
"name": "runs",
"options": [
{
"label": "lint",
"value": "lint"
},
{
"label": "test",
"value": "test"
},
{
"label": "bench",
"value": "bench"
}
],
"selected": [
"lint",
"test"
],
"type": "chips"
},
{
"action": "add-check",
"fallback": {
"title": "add"
},
"id": "add-check",
"label": "add",
"style": "primary",
"type": "button"
}
],
"fallback": {
"title": "Add a check"
},
"id": "add",
"title": "Add a check",
"type": "sheet"
}
],
"fallback": {
"title": "screen"
},
"id": "sheet",
"type": "screen"
}Its fallback
What a renderer without
sheet draws: a row from the fallback the block carries.Add a check
Style hooks
.b-sheetthe block
[data-block=sheet]every block of the kind
[data-id=add]this one block
Every page here is a blocks
Screen, written by site::page: no hand-written HTML. Source: https://github.com/jirathip-dev/blocks