Breadcrumb
Цепочка навигации до текущей страницы.
github.com/fastygo/templ/components
Цепочка навигации до текущей страницы.
Стандартная цепочка
import cmp "github.com/fastygo/templ/components"
templ Example() {
@cmp.Breadcrumb(cmp.BreadcrumbProps{
Items: []cmp.BreadcrumbItem{
{Label: "Главная", Href: "/"},
{Label: "Документация", Href: "/docs"},
{Label: "Кнопка", Current: true},
},
})
}
import cmp "github.com/fastygo/templ/components"
templ Example() {
@cmp.Breadcrumb(cmp.BreadcrumbProps{
Items: []cmp.BreadcrumbItem{
{Label: "Главная", Href: "/"},
{Label: "Документация", Href: "/docs"},
{Label: "Кнопка", Current: true},
},
})
}
Недоступный элемент
import cmp "github.com/fastygo/templ/components"
templ Example() {
@cmp.Breadcrumb(cmp.BreadcrumbProps{
Items: []cmp.BreadcrumbItem{
{Label: "Главная", Href: "/"},
{Label: "Заблокировано", Disabled: true},
},
})
}
import cmp "github.com/fastygo/templ/components"
templ Example() {
@cmp.Breadcrumb(cmp.BreadcrumbProps{
Items: []cmp.BreadcrumbItem{
{Label: "Главная", Href: "/"},
{Label: "Заблокировано", Disabled: true},
},
})
}
API
Items · []BreadcrumbItem — Элементы цепочки
Label · string — Подпись элемента
Href · string — Ссылка на раздел
Current · bool — Текущая страница (aria-current)
Disabled · bool — Недоступный элемент