Skip to content

Instantly share code, notes, and snippets.

@yasudacloud
Created November 8, 2025 15:40
Show Gist options
  • Select an option

  • Save yasudacloud/6ae4495dbab21cd0cf37dc83db07dd89 to your computer and use it in GitHub Desktop.

Select an option

Save yasudacloud/6ae4495dbab21cd0cf37dc83db07dd89 to your computer and use it in GitHub Desktop.
import {
useActiveBreakpoint,
defineProperties,
} from "figma:react";
function Frame3Desktop() {
return (
<div className="content-stretch flex items-center justify-center relative size-full">
<div className="flex flex-col font-['Rethink_Sans:Medium','Noto_Sans_JP:Medium',sans-serif] font-medium justify-center leading-[0] relative shrink-0 text-[30px] text-black text-center text-nowrap tracking-[-0.6px]">
<p className="leading-[1.2] whitespace-pre">
デフォで非表示のテキスト
</p>
</div>
</div>
);
}
function Frame3Tablet() {
return (
<div className="content-stretch flex items-center justify-center relative size-full">
<div className="flex flex-col font-['Rethink_Sans:Medium','Noto_Sans_JP:Medium',sans-serif] font-medium justify-center leading-[0] relative shrink-0 text-[30px] text-black text-center text-nowrap tracking-[-0.6px]">
<p className="leading-[1.2] whitespace-pre">
デフォで非表示のテキスト
</p>
</div>
</div>
);
}
function Frame3Mobile() {
return (
<div className="content-stretch flex items-center justify-center relative size-full">
<div className="flex flex-col font-['Rethink_Sans:Medium','Noto_Sans_JP:Medium',sans-serif] font-medium justify-center leading-[0] relative shrink-0 text-[30px] text-black text-center text-nowrap tracking-[-0.6px]">
<p className="leading-[1.2] whitespace-pre">
デフォで非表示のテキスト
</p>
</div>
</div>
);
}
function Frame({ isVisible = false }) {
const { width } = useActiveBreakpoint();
if (!isVisible) {
return null;
}
if (width < 800) {
return <Frame3Mobile />;
}
if (width < 1280) {
return <Frame3Tablet />;
}
return <Frame3Desktop />;
}
defineProperties(Frame, {
isVisible: {
type: "boolean",
defaultValue: false,
},
});
export default Frame;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment