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
  • Examples

Was this helpful?

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

@atomico/modal

Responsive generic modal component.

Previous@atomico/keen-sliderNext@atomico/lottie

Last updated 2 years ago

Was this helpful?

Webcomponent built with , Simple to use and customize modal. Includes additional support for React and Preact.

Modules

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

Properties

showAfterMs / show-after-ms: String, defines the milliseconds to wait for the activation of the modal.

show: Boolean, defines whether or not to show the modal.

padding: String responsivo, define a padding for the content of the modal, example:

  1. padding="1rem"

  2. padding="1rem, 2rem 720px, 3rem 1080px"

position: String responsivo, defines the position of the content within the modal, example:

  1. position="center"

  2. position="center top"

  3. position="center bottom"

  4. position="left center"

  5. position="right center"

  6. position="center, right bottom 1080px"

fullSize / full-size: Boolean, It enables the use of background in the modal, this is complemented by the background slot to attach personalized content in the background.

fullSizeClosed / full-size-closed: Boolean, defines whether clicking on the background hides the modal.

Examples

React

Atomico JS
components/src/components/modal at master ยท atomicojs/componentsGitHub
@atomico/modal (React) - StackBlitzStackBlitz
Logo
Logo