danhper / phoenix-active-link Goto Github PK
View Code? Open in Web Editor NEWElixir/Phoenix view helper to manage "active" state of a link
Home Page: https://hex.pm/packages/phoenix_active_link
License: MIT License
Elixir/Phoenix view helper to manage "active" state of a link
Home Page: https://hex.pm/packages/phoenix_active_link
License: MIT License
Bootstrap expects active links like this
<li class="nav-item active">
<a class="nav-link" href="/about">About</a>
</li>
But when you set the active tag like this
<%= active_link(@conn, "About", to: page_path(@conn, :about), wrap_tag: :li, class_active: "active nav-item", class_inactive: "nav-item") %>
The output isn't correct. I want apply nav-link to the inner link and no other classes.
<li class="active nav-item">
<a class="active nav-item" href="/about">About</a>
</li>
It would be nice to be able to add icons, Font Awesome or whatever other lib to links.
This is an example with Navbar, valid for links to
https://stackoverflow.com/questions/35005960/font-awesome-and-bootstrap-4-navbar
I have a use case where I need to set some attributes on an active_link.
At the moment, phoenix-active-link doesn't pass these options forward to link.
If I use active_link
by it's own I get undefined function active_link/3
.
However it works if I specify the mondule name PhoenixActiveLink.active_link
.
Is there any missing step?
Trying to install, but getting this error:
Failed to use "phoenix_html" (version 3.2.0) because
phoenix_active_link (version 0.2.1) requires ~> 2.10
phoenix_ecto (version 4.4.0) requires ~> 2.14.2 or ~> 3.0
phoenix_live_view (version 0.17.9) requires ~> 3.1
mix.lock specifies 3.2.0
running phoenix 1.6.7
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.