Skip to content

struct

Doc

pub struct Doc {
    pub name: &'static str,
    pub category: &'static str,
    pub summary: &'static str,
    pub usage: &'static str,
    pub focus: &'static str,
    pub dark: bool,
    pub parts: &'static [Part],
}

Documentation for a family of parts.

Fields

name

pub name: &'static str

The family (and its main part's) name.

category

pub category: &'static str

The catalogue section it's listed under.

summary

pub summary: &'static str

What the family is for.

usage

pub usage: &'static str

A template using the family; data comes from demo_scope.

focus

pub focus: &'static str

The part the catalogue's playground customises.

dark

pub dark: bool

Whether the example looks best on a dark background.

parts

pub parts: &'static [Part]

The components in the family, its main one first.

Methods

is_chart

pub fn is_chart(&self) -> bool

Whether it's listed under one of the chart categories.

slug

pub fn slug(&self) -> String

An anchor-friendly id ("DropdownMenu" → "dropdown-menu").

part

pub fn part(&self, name: &str) -> Option<&'static Part>

The part called name (CardTitle in Card's doc), if it has one.

focus_part

pub fn focus_part(&self) -> &'static Part

The part the playground customises.

Trait implementations