Link¶

class bootlace.nav.elements.Link(link: ~bootlace.links.LinkBase, id: str = NOTHING, a: ~bootlace.util.Tag = Tag(tag=<class 'dominate.tags.a'>, classes={'nav-link'}, attributes={}))[source]¶

Bases: NavElement

A link in the nav bar, either for a view or a literal URL

Attributes Summary

a

active

Whether the link is active.

enabled

Whether the link is enabled.

id

The ID of the element

link

The link to display, either a URL or a view

url

The URL for the link.

Methods Summary

__tag__()

element_state(tag)

Apply active and enabled states to the tag.

with_url(url, text, **kwargs)

Create a link with a URL.

with_view(endpoint, text, **kwargs)

Create a link with a view.

Attributes Documentation

a: Tag¶
active¶

Whether the link is active.

enabled¶

Whether the link is enabled.

id: str¶

The ID of the element

link: LinkBase¶

The link to display, either a URL or a view

url¶

The URL for the link.

Methods Documentation

__tag__() → dom_tag[source]¶
element_state(tag: dom_tag) → dom_tag¶

Apply active and enabled states to the tag.

classmethod with_url(url: str, text: Taggable | dom_tag | str | Iterable[Taggable | dom_tag], **kwargs: Any) → Link[source]¶

Create a link with a URL.

classmethod with_view(endpoint: str, text: Taggable | dom_tag | str | Iterable[Taggable | dom_tag], **kwargs: Any) → Link[source]¶

Create a link with a view.

Bootlace

Navigation

Contents:

  • Getting Started
  • API Reference
    • Breadcrumbs
    • Forms
    • Bootstrap Icons
    • Images
    • Links
    • Navigation
    • Layout, sizing and colors
    • Tables
    • Tools and Utilities

Related Topics

  • Documentation overview
    • API Reference
      • Navigation
        • Previous: NavStyle
        • Next: Separator
©2024, Alex Rudy. | Powered by Sphinx 8.1.3 & Alabaster 1.0.0 | Page source