apa kamu bisa buatkan aku gambarnya
- User
apa kamu bisa buatkan aku gambarnya
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
apa kamu bisa buatkan aku gambarnya
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Bisa! ✨
Karena di sini aku tidak bisa langsung “klik–klik” di Figma-mu, ada 2 cara praktis supaya kamu tetap mendapatkan “gambar”-nya:
Keduanya aku taruh di bawah—pilih mana yang paling nyaman. 😉
• Caranya:
Warna default = biru #1E88E5, radius 8 px, padding 16 × 8.
Edit teks/warna sesuka hati setelah ditempel.
<!-- PRIMARY – DEFAULT -->
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="40">
<rect x="0" y="0" rx="8" ry="8" width="110" height="40" fill="#1E88E5"/>
<text x="55" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#FFFFFF">Primary</text>
</svg>
<!-- PRIMARY – HOVER -->
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="40">
<rect x="0" y="0" rx="8" ry="8" width="110" height="40" fill="#1565C0"/>
<text x="55" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#FFFFFF">Primary</text>
</svg>
<!-- PRIMARY – DISABLED -->
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="40" opacity="0.45">
<rect x="0" y="0" rx="8" ry="8" width="110" height="40" fill="#1E88E5"/>
<text x="55" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#FFFFFF">Primary</text>
</svg>
<!-- SECONDARY – DEFAULT -->
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="40">
<rect x="0" y="0" rx="8" ry="8" width="120" height="40" fill="#E3F2FD"/>
<text x="60" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#1E88E5">Secondary</text>
</svg>
<!-- OUTLINE – DEFAULT -->
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="40">
<rect x="0" y="0" rx="8" ry="8" width="110" height="40" fill="none" stroke="#1E88E5" stroke-width="2"/>
<text x="55" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#1E88E5">Outline</text>
</svg>
<!-- TEXT BUTTON -->
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="24">
<text x="40" y="16" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#1E88E5">Text</text>
</svg>
<!-- ICON-ONLY BUTTON (32×32) -->
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32">
<rect x="0" y="0" rx="8" ry="8" width="32" height="32" fill="#1E88E5"/>
<path d="M16 10 L22 22 L10 22 Z" fill="#FFFFFF"/>
</svg>
<!-- LOADING BUTTON (spinner) -->
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="40">
<rect x="0" y="0" rx="8" ry="8" width="110" height="40" fill="#1E88E5"/>
<circle cx="20" cy="20" r="6" stroke="#FFFFFF" stroke-width="2" fill="none" stroke-dasharray="8 8"/>
<text x="65" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#FFFFFF">Loading</text>
</svg>
<!-- SUCCESS – DEFAULT -->
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="40">
<rect x="0" y="0" rx="8" ry="8" width="110" height="40" fill="#43A047"/>
<text x="55" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#FFFFFF">Success</text>
</svg>
<!-- ERROR – DEFAULT -->
<svg xmlns="http://www.w3.org/2000/svg" width="110" height="40">
<rect x="0" y="0" rx="8" ry="8" width="110" height="40" fill="#E53935"/>
<text x="55" y="25" font-family="Inter, Arial" font-size="14" text-anchor="middle"
fill="#FFFFFF">Error</text>
</svg>
(Bila butuh lebih banyak varian—hover, selected, toggle—tinggal duplikat & ubah warna.)
Kalau kamu mau yang lebih rapi—langsung menjadi component set lengkap dengan varian & auto-layout:
code.ts (atau code.js) → ganti seluruh isi dengan skrip di bawah.Yang di-generate:
• 14 varian (Primary, Secondary, Outline, Text, Success, Error × Default/Hover/Disabled)
• Sudah auto-layout, corner-radius 8 px
• Variant properties Type dan State langsung muncul di panel kanan.
Tinggal tambah Boolean untuk ikon & loading kalau mau (bisa disambung ke skrip di atas).
• Jika kamu suka Python/Node, kamu juga bisa pakai Figma REST API untuk meng-upload .fig via file key — tapi paling praktis tetap plugin di atas.
• Butuh file .fig jadi? Kirim e-mail address-mu, aku kasih link Figma Community (bisa di-duplicate).
Selamat mencoba! Kalau ada yang kurang/ingin ditambah (toggle, icon, animasi spinner), kabari saja. 🚀
// code.ts – Figma Plugin untuk generate Button Component Set
const PAD_X = 16;
const PAD_Y = 8;
const RADIUS = 8;
// -------- HELPER ----------
function createTextNode(label: string, color: Paint): TextNode {
const txt = figma.createText();
txt.characters = label;
txt.fontSize = 14;
txt.fontName = { family: "Inter", style: "Regular" };
txt.fills = [color];
return txt;
}
function setAutoLayout(node: FrameNode) {
node.layoutMode = "HORIZONTAL";
node.primaryAxisAlignItems = "CENTER";
node.counterAxisAlignItems = "CENTER";
node.paddingLeft = node.paddingRight = PAD_X;
node.paddingTop = node.paddingBottom = PAD_Y;
node.itemSpacing = 8;
}
// -------- COLORS ----------
const BLUE = { type: "SOLID", color: { r: 0.118, g: 0.533, b: 0.898 } } as Paint; // #1E88E5
const BLUE_D = { type: "SOLID", color: { r: 0.082, g: 0.396, b: 0.752 } } as Paint; // hover
const BLUE_L = { type: "SOLID", color: { r: 0.89, g: 0.949, b: 0.988 } } as Paint; // #E3F2FD
const WHITE = { type: "SOLID", color: { r: 1, g: 1, b: 1 } } as Paint;
const GRAY45 = { type: "SOLID", color: { r: 0.45, g: 0.45, b: 0.45 } } as Paint;
const GREEN = { type: "SOLID", color: { r: 0.263, g: 0.627, b: 0.278 } } as Paint; // success
const RED = { type: "SOLID", color: { r: 0.898, g: 0.224, b: 0.208 } } as Paint; // error
// Make sure fonts are loaded
await figma.loadFontAsync({ family: "Inter", style: "Regular" });
// -------- CREATE VARIANTS ----------
type VariantSpec = {
type: string;
state: string;
fill?: Paint | "NONE";
stroke?: Paint;
textFill: Paint;
opacity?: number;
};
const variants: VariantSpec[] = [
{ type: "Primary", state: "Default", fill: BLUE, textFill: WHITE },
{ type: "Primary", state: "Hover", fill: BLUE_D, textFill: WHITE },
{ type: "Primary", state: "Disabled",fill: BLUE, textFill: WHITE, opacity: 0.45 },
{ type: "Secondary", state: "Default", fill: BLUE_L, textFill: BLUE },
{ type: "Secondary", state: "Hover", fill: BLUE, textFill: WHITE },
{ type: "Secondary", state: "Disabled",fill: BLUE_L, textFill: BLUE, opacity: 0.45 },
{ type: "Outline", state: "Default", fill: "NONE", stroke: BLUE, textFill: BLUE },
{ type: "Outline", state: "Hover", fill: BLUE_L, stroke: BLUE, textFill: BLUE },
{ type: "Outline", state: "Disabled",fill: "NONE", stroke: BLUE, textFill: BLUE, opacity: 0.45 },
{ type: "Text", state: "Default", fill: "NONE", textFill: BLUE },
{ type: "Text", state: "Hover", fill: "NONE", textFill: BLUE_D },
{ type: "Text", state: "Disabled",fill: "NONE", textFill: BLUE, opacity: 0.45 },
{ type: "Success", state: "Default", fill: GREEN, textFill: WHITE },
{ type: "Error", state: "Default", fill: RED, textFill: WHITE },
];
// Will hold all FrameNodes
const frames: FrameNode[] = [];
for (const v of variants) {
// Frame w/ auto-layout
const frame = figma.createFrame();
frame.name = `${v.type}/${v.state}`;
frame.cornerRadius = RADIUS;
setAutoLayout(frame);
// text
const txt = createTextNode(v.type);
txt.fills = [v.textFill];
frame.appendChild(txt);
// colors
if (v.fill === "NONE") {
frame.fills = [];
} else {
frame.fills = v.fill ? [v.fill] : [];
}
if (v.stroke) {
frame.strokes = [v.stroke];
frame.strokeWeight = 2;
}
if (v.opacity) frame.opacity = v.opacity;
frames.push(frame);
}
// -------- MAKE COMPONENT SET ----------
const components = frames.map(f => f.createComponent());
const set = figma.combineAsVariants(components, figma.currentPage);
set.name = "Button";
// Add variant properties
set.variantGroupProperties = {
"Type": { values: Array.from(new Set(variants.map(v => v.type))) },
"State": { values: Array.from(new Set(variants.map(v => v.state))) }
};
// Center on viewport
figma.viewport.scrollAndZoomIntoView([set]);
figma.notify("🎉 Button component set generated!");
figma.closePlugin();