Coder Social home page Coder Social logo

sourceboat / tabler_icons_elixir Goto Github PK

View Code? Open in Web Editor NEW
9.0 5.0 0.0 4.13 MB

This package provides Elixir functions in order to use Tabler Icons in your HTML, styled with arbitrary classes.

Home Page: https://hex.pm/packages/tabler_icons

License: MIT License

Elixir 100.00%
elixir phoenix-framework phoenix-liveview

tabler_icons_elixir's Introduction

Tabler Icons

CI Hex Hex Docs

Tabler Icons are free and open source icons. This package provides Elixir functions in order to use Tabler Icons in your HTML, styled with arbitrary classes.

This package is strongly inspired by heroicons_elixir.

Note: As we are dealing with over 3.000 icons and an output file with more than 70.000 lines of code, the compile time may be longer than usual.

Installation

The package can be installed by adding tabler_icons to your list of dependencies in mix.exs:

def deps do
  [
    {:tabler_icons, "~> 0.5.0"}
  ]
end

Usage

<TablerIcons.user />
<TablerIcons.icon name={:user} />

You may pass arbitrary HTML attributes to the components:

<TablerIcons.user class="w-2 h-2" />
<TablerIcons.icon name={:user} class="w-2 h-2" />

For additional information and list of all icons see the docs.

Naming

We are interested in keeping the same icon names for our functions TablerIcons provides to us. Nevertheless, Elixir do not allow function names to begin with a number. Therefore we had to add some exceptions:

  • 2fa -> two_fa
  • 3d-cube-sphere-off -> three_d_cube_sphere_off
  • 3d-cube-sphere -> three_d_cube_sphere
  • 3d-rotate -> three_d_rotate
  • 24-hours -> twenty_four_hours
  • 12-hours -> twelve_hours
  • 123 -> one_two_three
  • 360-view -> three_sixty_view
  • 360 -> three_sixty

A hyphen is replaced by an underscore automatically.

Update TablerIcons version

You can find the current TablerIcons version in lib/tabler_icons.ex.

Updating the TablerIcons version is usually done by the maintainers of this package so you may ignore this.

  1. Check whether there are icon names that begin with a number and add exception to lib/mix/tasks/build.ex (add icon name to readme).
  2. Update TablerIcons version in lib/mix/tasks/download.ex.
  3. Run mix download in order to download newest icons into /assets.
  4. Run mix build in order to build new lib/tabler_icons.ex file based on the icons.
  5. Update version in mix.exs.
  6. Update repository with the corresponding changes.
  7. Release new version of the package.

tabler_icons_elixir's People

Contributors

13ue avatar dependabot[bot] avatar flo0807 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tabler_icons_elixir's Issues

Dynamic icons

Add component to render icon components dynamically.

For example <TablerIcons.icon name={:user} />

Tests

Add tests.

  • LiveView: test component returns corresponding svg
  • Test documentation

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.