Socket
Socket
Sign inDemoInstall

svelte-show

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    svelte-show

Like `v-show` in `vuejs`, or `ng-show` in `angularjs`, `svelte-show` just hide the element, it does not destroy the components inside its block. This library is used for cases when we need to keep the HTML elements retain in DOM, to avoid re-initializatio


Version published
Maintainers
1
Install size
3.37 kB
Created

Readme

Source

svelte-show

Like v-show in vuejs, or ng-show in angularjs, svelte-show just hide the element, it does not destroy the components inside its block. This library is used for cases when we need to keep the HTML elements retain in DOM, to avoid re-initialization when working with some 3rd libraries.

Usage

<script>
  import Show from "svelte-show/Show.svelte";
  let show = true;
</script>
<button on:click={() => { show = !show}}>
  Click to Show/Hide Content
</button>
<Show {show}>
  <div>Content</div>
</Show>

For TypeScript, import the same way:

<script lang="ts">
  import Show from "svelte-show/Show.svelte";
  ...

Keywords

FAQs

Last updated on 04 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc