Code Monkey home page Code Monkey logo

svelte-link's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

madeleineostoja

svelte-link's Issues

[feature] Default outbound to true if `href` points to an external url

Hey just a small feature request โ€” it would be great if the default for outbound was a little smarter, and defaulted to true if href is an external URL, which the user can easily override with outbound={false} to force all links to be same-target.

This would be especially useful if you don't have control over the href, for example in content from a CMS, where you want external links to automatically be outbound.

Happy to submit a PR if you're open to it

Type declaration should use new `SvelteComponentTyped` base class

When importing svelte-link into a typescript project, it gives the following error (at least in VS Code):

JSX element class does not support attributes because it does not have a '$$prop_def' property

Using the new SvelteComponentTyped base class in Link.d.ts fixes the issue, but not sure if this should be a PR here or against sveld

export default class Link extends SvelteComponentTyped<LinkProps> {}

Feature Request: .active class on route match

A regular use-case for a generic Link component is simply to add an .active (most common) class for styling differences, indication of navigation, etc, rather than adding that logic to each link's implementation code.

If you added that automatic injection when a route prefix matches (for deep navigation) with an exact modifier to force a full path match, that would be awesome...

<Link href="/about">About</Link>
<!-- when viewed at "/about/somewhere" should render: -->
<a href="/about" class="active">About</Link>

<Link href="/about" exact>About</Link>
<!-- when viewed at "/about/somewhere" should render: -->
<a href="/about">About</Link>

Just a suggestion!

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.