Fields vs icons
Stay organized with collections
Save and categorize content based on your preferences.
Fields and icons are both visual elements that appear on a block, but they have
different purposes.
Fields show or define data about a block that affects how a program functions.
For example, the text block has two quotation marks, which indicate that you are
defining a string, and a text input that lets you define that string. The
quotation marks tell you about the function of the block, and the input lets
you modify the function.
Icons show or define "meta" information about the block itself. For example,
you can append a comment icon to any block, which lets you write notes to
yourself, but does not affect how the block functions within the program.
Comparison of functionality
Attribute |
Fields |
Icons |
Rendering
|
Fields can be made of
whatever elements they want. |
Icons can be made of whatever
elements they want. |
Number
|
Fields can each appear any
number of times in a block. |
Icons can each appear once in
a block. |
Placement
|
Fields can be positioned in
any location on any input of
a block. |
Icons are always positioned at
the top-start of a block.
|
Serialization
|
Fields can be serialized, and
often are.
|
Icons can be serialized, but
are often not, because they
often don't have state. |
Collapsing
|
Fields are hidden when a
block is collapsed and their
text is shown instead. |
Icons can control whether they
are shown or hidden when the
block is collapsed. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eFields define a block's data and functionality, while icons provide metadata or supplemental information about the block.\u003c/p\u003e\n"],["\u003cp\u003eFields can have multiple instances, flexible positioning, and are often serialized, whereas icons are singular, positioned at the top-start, and may not always be serialized.\u003c/p\u003e\n"],["\u003cp\u003eBoth fields and icons are visual elements on a block and offer flexibility in their rendering using various elements.\u003c/p\u003e\n"]]],["Fields and icons are distinct visual elements on a block with different purposes. Fields display or define data affecting a program's function, like the quotation marks and text input on a text block. Icons provide \"meta\" information about a block, such as a comment icon, which doesn't impact program function. Fields can appear multiple times, have varied rendering and placement, and are often serialized. Icons appear once per block, are fixed at the top-start, and are often not serialized, but can control visibility when a block is collapsed.\n"],null,["# Fields vs icons\n\nFields and icons are both visual elements that appear on a block, but they have\ndifferent purposes.\n\nFields show or define data about a block that affects how a program functions.\nFor example, the text block has two quotation marks, which indicate that you are\ndefining a string, and a text input that lets you define that string. The\nquotation marks tell you about the function of the block, and the input lets\nyou modify the function.\n\nIcons show or define \"meta\" information about the block itself. For example,\nyou can append a comment icon to any block, which lets you write notes to\nyourself, but does not affect how the block functions within the program.\n\nComparison of functionality\n---------------------------\n\n| Attribute | Fields | Icons |\n|---------------|------------------------------------------------------------------------------|----------------------------------------------------------------------------------|\n| Rendering | Fields can be made of whatever elements they want. | Icons can be made of whatever elements they want. |\n| Number | Fields can each appear any number of times in a block. | Icons can each appear once in a block. |\n| Placement | Fields can be positioned in any location on any input of a block. | Icons are always positioned at the top-start of a block. |\n| Serialization | Fields can be serialized, and often are. | Icons can be serialized, but are often not, because they often don't have state. |\n| Collapsing | Fields are hidden when a block is collapsed and their text is shown instead. | Icons can control whether they are shown or hidden when the block is collapsed. |"]]