Merge pull request #23 from nodes-vapor/release/4.0.0 Release/4.0.0
Merge pull request #23 from nodes-vapor/release/4.0.0
Release/4.0.0
This package wraps Bootstrap elements into convenient Leaf-Tags.
Add Bootstrap to the package dependencies (in your Package.swift file):
Bootstrap
Package.swift
dependencies: [ ..., .package(url: "https://github.com/nodes-vapor/bootstrap.git", from: "4.0.0") ]
as well as to your target (e.g. “App”):
targets: [ ... .target( name: "App", dependencies: [... "Bootstrap" ...] ), ... ]
First import Bootstrap and Leaf inside your configure.swift
configure.swift
import Bootstrap import Leaf
In order to render the Bootstrap elements, you will need to add the Bootstrap Leaf tags:
public func configure(_ config: inout Config, _ env: inout Environment, _ services: inout Services) throws { services.register { _ -> LeafTagConfig in var tags = LeafTagConfig.default() tags.useBootstrapLeafTags() return tags } }
#bs:alert() { alert text }
#bs:badge(type?, classExtras?, attributes?) { badge text }
#bs:button(type?, classExtras?, attributes?) { btn text }
#bs:buttonGroup(isVertical, classExtras?, Aria?) { }
#bs:buttonGroup(false, "btn-group-sm") { #bs:button() { First Option } #bs:button("danger") { Second Option} #bs:button() { Third Option} }
#bs:buttonToolbar(classExtras?, Aria?) { }
#bs:buttonToolbar() { #bs:button() { First Option } #bs:button("danger") { Second Option} #bs:button() { Third Option} }
#bs:input(type?, classExtras?, attributes?)
#bs:breadcrumb(classExtras?, attributes?) { #bs:breadcrumbItem(classExtras?, attributes?) { <a href="/"> Home </a> } #bs:breadcrumbItem(classExtras?, attributes?) { Profile } }
#bs:textArea(classExtras?, attributes?, value?)
#bs:card(title?, classExtras?, attributes?) { <card body> }
or
#bs:card:outer(title?, classExtras?, attributes?) { #bs:card:header(classExtras?, attributes?) { <card header, if more than a simple string should be rendered> } #bs:card:body(classExtras?, attributes?) { <card contents> } #bs:card:footer(classExtras?, attributes?) { <card footer> } }
This package is developed and maintained by the Vapor team at Nodes.
This package is open-sourced software licensed under the MIT license
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Bootstrap 🍃
This package wraps Bootstrap elements into convenient Leaf-Tags.
Installation
Add
Bootstrap
to the package dependencies (in yourPackage.swift
file):as well as to your target (e.g. “App”):
Getting started 🚀
First import Bootstrap and Leaf inside your
configure.swift
Adding the Leaf tags
In order to render the Bootstrap elements, you will need to add the Bootstrap Leaf tags:
Supported tags
Alert
Badge
Button
Button Group
Button Toolbar
Input
Breadcrumb
Textarea
Card
or
🏆 Credits
This package is developed and maintained by the Vapor team at Nodes.
📄 License
This package is open-sourced software licensed under the MIT license