LogoLogo
GithubTwitterDiscordPlayground
English
English
  • ๐Ÿ‘‹Atomico
  • ๐Ÿš€Getting started with Atomico
  • โš›๏ธGetting started with Atomico for React users
  • ๐Ÿ’กWhat can you do with Atomico?
    • You can create amazing webcomponents
    • You can create design systems
    • You can create websites
    • You can create mobile applications
    • You can create web applications
  • API
    • ๐ŸงฌProps(Properties)
      • Value cycle as prop
      • Is it advisable to declare events using the props API?
    • ๐ŸงฉVirtualDOM
      • Advanced
    • ๐ŸŽฃHooks
      • useProp
      • useEvent
      • useRef
      • useHost
      • useState
      • useReducer
      • useEffect, useLayoutEffect and useInsertionEffect
      • useMemo and useCallback
      • useUpdate
      • useId
      • useContext
        • useProvider
      • usePromise
      • useAsync and useSuspense
      • useAbortController
    • ๐Ÿ”ฌTesting
      • Render cycle
      • atomico/test-hooks
      • atomico/test-dom
  • Guides
    • ๐Ÿค”Frequent questions
      • Is it advisable to declare events using the props API?
      • How to declare events for your component at the type level for TSX?
      • When and why to use shadowDom?
      • Can I use Atomico in browsers without ESM support?
    • ๐ŸคฉComponent
      • Naming
      • CSS Styles with Shadow DOM
    • ๐Ÿ›ก๏ธAtomico with Typescript
      • Props
      • Component
      • Meta-types
        • Type
        • Event declaration
        • Method declaration
      • Check the correct use of hooks
    • ๐ŸคAtomico and React
      • Integrating Atomico in React
      • From React to Atomico
        • Rendering Differences
        • VirtualDOM api differences
    • โณAtomico and Asynchrony
    • ๐Ÿง Atomico design patterns
      • โ™ป๏ธWebcomponents with hybrid rendering
      • ๐Ÿ”—Slot as templates
      • ๐Ÿ”€Slot
    • ๐Ÿ“–Atomico and Storybook
      • Frequent questions
    • ๐Ÿ’งSSR / SSG
    • ๐Ÿ—ƒ๏ธArchives
      • Class inheritance
      • Forms and shadowDOM
      • Tips
      • Design systems
      • Atomico style guide
        • File structure
          • Monorepo
          • Design systems
  • packages
    • @atomico/hooks
      • useCurrentValue
      • use-intersection-observer
      • use-ref-values
      • use-script
      • use-attributes
      • use-prop-proxy
      • use-click-press
      • use-dollars
      • use-reflect-event
      • use-keyboar
      • use-click-coordinates
      • use-copy
      • use-debounce-state
      • use-form
      • use-listener
      • use-disabled
      • use-css
      • use-channel
      • use-promise
      • use-responsive-state
      • use-parent
      • use-resize-observer
      • use-slot
        • useSlot
        • useProxySlot
      • use-render
      • use-mutation-observer
      • use-css-light-dom
      • use-controller
      • use-router
      • use-async-effect
      • use-child-nodes
      • use-force-render
    • @atomico/store
      • Store
    • @atomico/storybook
    • @atomico/router
    • @atomico/vite
      • โš™๏ธProcess CSS tag template blocks with PostCSS.
      • ๐Ÿ—๏ธCompile your code to be distributed optimally as a package.
      • ๐Ÿ“•Use the JSX/TSX syntax of Atomico when using Storybook.
      • ๐Ÿค–Automatically create customElements.define
      • โ˜‘๏ธSupport for Vitest for Atomico.
      • ๐Ÿง™โ€โ™‚๏ธServer actions
    • @atomico/exports
      • ๐ŸšฉCLI and Flags
      • ๐Ÿค–Wrapper for React
    • @atomico/components
      • @atomico/keen-slider
      • @atomico/modal
      • @atomico/lottie
      • @atomico/table
    • @atomico/react
    • @atomico/postcss-tokens
      • Example with @atomico/vite
    • @atomico/wrapper
    • ๐ŸšซDeprecated
      • @atomico/magic-form
        • MagicFormProvider | <magic-form-provider>
        • MagicForm | <magic-form>
        • MagicForm Hooks
        • MagicForm in React and Preact
        • MagicForm in Microfrontend
        • MagicForm Patterns
      • @atomico/design-tokens
        • @atomico/design-tokens api
  • Support
    • Discord
    • Github
    • Twitter
Powered by GitBook
On this page
  • Modules
  • Properties / attributes
  • Events
  • Methods
  • Examples

Was this helpful?

Edit on GitHub
Export as PDF
  1. packages
  2. @atomico/components

@atomico/keen-slider

The Keen-slider api but with WebComponents

Previous@atomico/componentsNext@atomico/modal

Last updated 2 years ago

Was this helpful?

Webcomponent built with to use as webcomponent. Includes additional support for React and Preact.

Modules

import { KeenSlider } from "@atomico/keen-slider";

// Import that does not associate the tagName by default
import { KeenSlider } from "@atomico/keen-slider/elements";
import { KeenSlider } from "@atomico/keen-slider/react";
import { KeenSlider } from "@atomico/keen-slider/preact";
<script 
    type="module" 
    src="http://esm.sh/@atomico/keen-slider"></script>
    
<atomico-keen-slider><atomico-keen-slider>

Properties / attributes

Prop/Attr
Type / default
Description

loop

boolean

Enables or disables carousel/loop functionality of the slider.

drag

boolean

Enables or disables mouse and touch control. Default is tru

disabled

boolean

vertical

boolean

Changes the direction of the slider from horizontal to vertical. (Note: The height of the container must be defined if vertical is true) Default is false.

rtl

boolean

Changes the direction in which the slides are positioned, from left-to-right to right-to-left. Default is false.

rubberband

boolean

Enables or disables the rubberband behavior for dragging and animation after a drag. Default is tr

autoplay

boolean

autoplayLoop / autoplay-loop

number / 2000

initial

number

mode

"snap" | "free" | "free-snap"

slidesPerView / slides-per-view

string

slidesSpacing / slides-spacing

string

slidesOrigin / slides-origin

string

slider

KeenSliderInstance

The slidesPerView, slidesSpacing and slidesOrigin props accept responsive expressions, example:

<atomico-keen-slider 
    slider-per-view="1, 2 520px, 3 720px"
></atomico-keen-slider>

Events

CreateSlider

dispatched when defining the slider prop, useful for accessing the keen-slider instance

Methods

KeenSlider.next()

next slide

KeenSlider.prev()

prev slide

Examples

React

most of the properties are homologous to

keen-slider documentation
Atomico JS
keen-slider
Logocomponents/src/components/keen-slider at master ยท atomicojs/componentsGitHub
Logo@atomico/keen-slider (React) - StackBlitzStackBlitz