Skip to main content

table_header

Function table_header 

Source
pub fn table_header<I, E>(rows: I) -> El
where I: IntoIterator<Item = E>, E: Into<El>,
Examples found in repository?
examples/dashboard_01_calibration.rs (lines 363-374)
359fn documents_card() -> El {
360    card([
361        card_header([card_title("Documents")]).padding(tokens::SPACE_4),
362        card_content([scroll([table([
363            table_header([table_row([
364                table_head("").width(Size::Fixed(35.0)),
365                table_head("Header").width(Size::Fill(1.8)),
366                table_head("Section Type").width(Size::Fill(1.0)),
367                table_head("Status").width(Size::Fixed(104.0)),
368                table_head("Target").width(Size::Fixed(64.0)),
369                table_head("Limit").width(Size::Fixed(64.0)),
370                table_head("Reviewer").width(Size::Fixed(128.0)),
371                table_head("").width(Size::Fixed(32.0)),
372            ])
373            .padding(Sides::xy(tokens::SPACE_4, 0.0))
374            .key("metric:table.header")]),
375            divider(),
376            table_body([
377                document_row(
378                    "Cover page",
379                    "Cover page",
380                    "In Process",
381                    "18",
382                    "5",
383                    "Eddie Lake",
384                    "info",
385                ),
386                document_row(
387                    "Table of contents",
388                    "Table of contents",
389                    "Done",
390                    "29",
391                    "24",
392                    "Eddie Lake",
393                    "success",
394                ),
395            ]),
396        ])])
397        .height(Size::Fill(1.0))])
398        .gap(0.0)
399        .padding(0.0)
400        .height(Size::Fill(1.0)),
401    ])
402    .key("metric:table.card")
403    .height(Size::Fill(1.0))
404}
More examples
Hide additional examples
examples/polish_calibration.rs (lines 185-191)
181fn table_card() -> El {
182    card([
183        card_header([card_title("Reference rows")]),
184        card_content([table([
185            table_header([table_row([
186                table_head("Status").width(Size::Fixed(86.0)),
187                table_head("Surface").width(Size::Fill(1.0)),
188                table_head("Owner").width(Size::Fixed(110.0)),
189                table_head("State").width(Size::Fixed(86.0)),
190            ])
191            .key("metric:table.header")]),
192            divider(),
193            table_body([
194                data_row("OK", "Settings card", "core", "selected", true, "success"),
195                data_row(
196                    "WARN",
197                    "Command palette density",
198                    "widgets",
199                    "needs work",
200                    false,
201                    "warning",
202                ),
203                data_row(
204                    "ERR",
205                    "Disabled and invalid states",
206                    "style",
207                    "missing",
208                    false,
209                    "destructive",
210                ),
211                data_row(
212                    "INFO",
213                    "Token resolution",
214                    "theme",
215                    "planned",
216                    false,
217                    "info",
218                ),
219                data_row(
220                    "OK",
221                    "Popover elevation",
222                    "shader",
223                    "queued",
224                    false,
225                    "success",
226                ),
227            ])
228            .gap(tokens::SPACE_1)
229            .width(Size::Fill(1.0)),
230        ])]),
231    ])
232    .key("metric:table.card")
233    .width(Size::Fill(1.2))
234    .height(Size::Fill(1.0))
235}