Skip to content

🎥 Make videos programmatically with React

Elements: Simplify third-party library browsing

Igor Samokhovetse8d932c1be3c
diff --git a/packages/docs/elements/libraries.mdx b/packages/docs/elements/libraries.mdx
index ac00bbdb59..21973d2d03 100644
--- a/packages/docs/elements/libraries.mdx
+++ b/packages/docs/elements/libraries.mdx
@@ -1,19 +1,17 @@
---
-title: Third-party Elements
+title: More Elements
sidebar_label: More Elements
+hide_table_of_contents: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
description: Third-party Element Libraries that integrate with Remotion Studio.
---
import {ThirdPartyElementLibraries} from '@site/src/components/Elements/ThirdPartyElementLibraries';
-# Third-party Elements
-
-This is a list of third-party websites providing Remotion [Elements](/elements). They are not affiliated with Remotion.
-
-Click **Add to Studio** to register libraries in your project so you can quickly access them from Remotion Studio.
-
-Anybody can create Element Libraries. Follow the [Element guidelines](/docs/studio/creating-elements) when designing Elements, then read the [library integration guide](/docs/studio-protocol/component-library-integration) for instructions.
-
-Contact [[email protected]](mailto:[email protected]) to propose inclusion of your Element Library on this page.
+# More Elements
<ThirdPartyElementLibraries />
+
+<small>These libraries are not affiliated with Remotion. To propose a library for this page, contact [[email protected]](mailto:[email protected]).</small>
diff --git a/packages/docs/src/components/Elements/ThirdPartyElementLibraries.module.css b/packages/docs/src/components/Elements/ThirdPartyElementLibraries.module.css
index d2b87344d3..9023c29821 100644
--- a/packages/docs/src/components/Elements/ThirdPartyElementLibraries.module.css
+++ b/packages/docs/src/components/Elements/ThirdPartyElementLibraries.module.css
@@ -12,23 +12,20 @@
list-style: none;
}
-.card {
+.list > .card {
position: relative;
- width: 100%;
min-width: 0;
- overflow: hidden;
- border: 1px solid var(--border-color);
- border-radius: 14px;
- background: var(--ifm-color-emphasis-0);
- color: var(--text-color);
+ margin: 0;
}
.preview {
+ position: relative;
display: flex;
aspect-ratio: 1200 / 630;
align-items: center;
justify-content: center;
overflow: hidden;
+ border-radius: 8px;
background: var(--ifm-color-emphasis-100);
}
@@ -40,27 +37,19 @@
}
.content {
- padding: 14px;
-}
-
-.preview + .content {
- border-top: 1px solid var(--border-color);
-}
-
-.libraryRow {
- display: flex;
- gap: 12px;
- align-items: center;
- justify-content: space-between;
+ min-width: 0;
+ padding: 18px 0;
}
.libraryTitle {
min-width: 0;
margin: 0;
overflow-wrap: anywhere;
- font-size: 1rem;
- font-weight: 500;
- letter-spacing: -0.01em;
+ font-family: 'GTPlanar';
+ font-size: 1.125rem;
+ font-weight: 400;
+ text-align: center;
+ text-wrap: balance;
}
.card .libraryLink,
@@ -73,7 +62,7 @@
.libraryLink::after {
position: absolute;
inset: 0;
- border-radius: 13px;
+ border-radius: 8px;
content: '';
}
@@ -88,22 +77,52 @@
.libraryLink:focus-visible::after {
outline: 2px solid var(--ifm-color-primary);
- outline-offset: -2px;
+ outline-offset: 2px;
}
.addAction {
- position: relative;
+ position: absolute;
+ right: 12px;
+ bottom: 12px;
z-index: 1;
+ opacity: 0;
+ pointer-events: none;
}
-@container third-party-libraries (min-width: 640px) {
+.card:hover .addAction,
+.card:focus-within .addAction {
+ opacity: 1;
+ pointer-events: auto;
+}
+
+@media (hover: none), (pointer: coarse) {
+ .addAction {
+ opacity: 1;
+ pointer-events: auto;
+ }
+}
+
+:global([data-theme='dark']) .addAction {
+ --blue-underlay: var(--ifm-color-primary);
+}
+
+@container third-party-libraries (min-width: 440px) {
.list {
- grid-template-columns: repeat(2, minmax(0, 1fr));
+ grid-template-columns: repeat(2, minmax(0, 320px));
}
}
-@container third-party-libraries (max-width: 639px) {
+@container third-party-libraries (min-width: 640px) {
+ .list {
+ grid-template-columns: repeat(3, minmax(0, 320px));
+ gap: 24px;
+ }
+
.content {
- padding: 16px;
+ padding: 16px 0;
+ }
+
+ .libraryTitle {
+ font-size: 1rem;
}
}
diff --git a/packages/docs/src/components/Elements/ThirdPartyElementLibraries.tsx b/packages/docs/src/components/Elements/ThirdPartyElementLibraries.tsx
index acc5b3df53..992ebc0988 100644
--- a/packages/docs/src/components/Elements/ThirdPartyElementLibraries.tsx
+++ b/packages/docs/src/components/Elements/ThirdPartyElementLibraries.tsx
@@ -74,23 +74,11 @@ const ThirdPartyElementLibraryItem: React.FC<{
return (
<li className={styles.card}>
- {library.bannerUrl === null ? null : (
- <div className={styles.preview}>
+ <div className={styles.preview}>
+ {library.bannerUrl === null ? null : (
<img alt="" className={styles.previewImage} src={library.bannerUrl} />
- </div>
- )}
- <div className={styles.content}>
- <div className={styles.libraryRow}>
- <h3 className={styles.libraryTitle}>
- <a
- className={styles.libraryLink}
- href={library.browseUrl}
- rel="noreferrer"
- target={isEmbeddedInStudio ? '_self' : '_blank'}
- >
- {library.displayName}
- </a>
- </h3>
+ )}
+ <div className={styles.addAction}>
<BlueButton
ref={addButtonRef}
aria-busy={isLoading}
@@ -102,7 +90,6 @@ const ThirdPartyElementLibraryItem: React.FC<{
? `Sent ${library.displayName} to Studio`
: `Add ${library.displayName} to Studio`
}
- className={styles.addAction}
fullWidth={false}
loading={isLoading}
onClick={addToStudio}
@@ -120,6 +107,18 @@ const ThirdPartyElementLibraryItem: React.FC<{
</BlueButton>
</div>
</div>
+ <div className={styles.content}>
+ <h3 className={styles.libraryTitle}>
+ <a
+ className={styles.libraryLink}
+ href={library.browseUrl}
+ rel="noreferrer"
+ target={isEmbeddedInStudio ? '_self' : '_blank'}
+ >
+ {library.displayName}
+ </a>
+ </h3>
+ </div>
{isFallbackOpen ? (
<ElementLibraryInstallFallbackModal
buttonLabel={buttonLabel}