Giter Club home page Giter Club logo

tag-helpers's Introduction

tag-helpers

Setup

Add the following line inside your _ViewImports.cshtml file:

@addTagHelper *, Dewhitee.TagHelpers

Examples

Messages

Self-closing messages

<!-- Primitive messages -->
<hint msg="My hint" />
<error msg="My error message" />
<warn msg="My warning" />
<success msg="Success message"/>

<!-- You can set 'as' attribute to render message in specific way: -->
<hint msg="My hint" as="Callout" />
<error msg="My error" as="Note" />

<!-- 'when' attribute can be specified to set the condition under which tag message will be rendered -->
<warn msg="ATTENTION: ..." when="Model.MyValue is null" />

<!-- In case Modal mode is used - 'modal-id' attribute must be set to the id of a button that triggers this modal: -->
<help-modal-btn modal-id="my-modal-button" />
<hint msg="Some text as the content of a modal" as="Modal" modal-id="my-modal-button" />

Normal messages

If self-closing message tag is not an option *-msg tag helpers can be used instead:

<hint-msg>
  My hint message
</hint-msg>

<error-msg>
  My error message
</error-msg>

Buttons

<create-btn />

<delete-btn />

<submit-btn />

<save-btn />

<back-btn route="@Model.PreviousRoute" />

Collapse

<collapse-btn collapse-id="search" text="Search <i class='fas fs-search'></i>" />
<collapse collapse-id="search">
  Some content
</collapse>

Modals

<help-modal-btn modal-id="some-help" />
<help msg="Some help text" as="Modal" modal-id="some-help" />

Tabs

<tabs mode="Horizontal" tabs-id="my-tabs">
  <tab-buttons titles="Link 1, Link 2, Link 3"/>
  <tab-contents>
    <tab-content title="Link 1" active="true">
      Link 1 content
    </tab-content>
    <tab-content title="Link 2">
      Link 2 content
    </tab-content>
    <tab-content title="Link 3">
      Link 3 content
    </tab-content>
  </tab-contents>
</tabs>

tag-helpers's People

Contributors

dewhitee avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.