Skip to content
BigBang

Popular

    ↑↓Navigate↵OpenEscClose
    TR

    Components

    Anchor

    In-page navigation that links to the sections of a long page and marks the one being read.

    Storybook
    Storybook
    Source
    Source
    • On a long page with three or more sections: an agreement, a fee table, a settings summary.
    • For moving between pages: use Breadcrumbs or the sidebar.
    • For content that changes in one place: use Tabs.
    • On a short page: a list of links adds nothing.
    1. Title: the name of the navigation, “On this page” by default.
    2. Line: the thin border at the start of the links.
    3. Link: a #id link to a section heading.
    4. Current mark: the selected border on the link of the section being read.
    5. Sublinks: one level of subsections.
    • The links go to the sections with #id; browser history and shared links work.
    • Without current, the first section in the top 40 % of the viewport is current.
    • With current, the mark comes only from it; onCurrentChange is still called.
    • Use the section heading as the link text.
    • Use at most one sublevel.
    • Give the sections a scroll-margin-top that clears a fixed top bar.
    • Keep headings short and distinct: “Commission”, “Settlement”.
    • Tabs: panels that change in one place.
    • Breadcrumbs: where the page sits in the hierarchy.